CalculateIssuanceData
ss=esgc;
bas=allc;

[Lia Locb]=ismember(ss.industry,bas.industry);
comp.industry=ss.industry(Lia);
comp.dat=zeros(sum(Lia),length(ss.years),2);
comp.years=ss.years;
[Lia2 Locb2]=ismember(ss.years,bas.years);
comp.dat(:,:,1)=bas.dat(Locb(Locb>0),Locb2(Locb2>0));
comp.dat(:,:,2)=ss.dat(Lia,:);

lin{1}='-'; lin{2}='--'; lin{3}='-.'; lin{4}='-x'; lin{5}='-o';

subplot(2,1,1)
no=[19 25 50];
for i=1:length(no)
    plot(comp.years,100*comp.dat(no(i),:,2)./comp.dat(no(i),:,1),lin{i},'LineWidth',2)
    hold on;
end
hold off
legend(comp.industry(no),'Location','NorthWest')
legend('boxoff')
xlim([2012 2022])
title('Panel A: Corporate bonds, currency')
ylabel('Percent of amount issued')

subplot(2,1,2)
ind=sum((govt.datsum(:,2:7,1))'==0)==0;
country=govt.country(ind);
esg=squeeze(govt.datsum(ind,2:7,2)./govt.datsum(ind,2:7,1));
[B I]= sort(esg(:,end),'descend');
cou=[1:2 10 12 22];
no=length(cou);
for i=1:no 
    plot(govt.years(2:7),100*esg(I(cou(i)),:),lin{i},'LineWidth',2)
    hold on;
end
hold off
legend(country(I(cou(1:no))),'Location','NorthWest')
legend('boxoff')
xlim([2017 2022])
xticks(2017:2022)
title('Panel B: Government ESG bonds')
ylabel('Percent of amount issued')